'***************************************************************** '** Example to illustrate the speed of transferring data ** '** over the bus from the 2001 by turning AUTO ZERO off, ** '** AUTORANGE off, ASCII data streaming, 4.5 Digits of ** '** Resolution, and turning off the front panel display of ** '** the 2001. ** '** ** '** Author: Jonathan L. Tucker ** '** Date: June 16, 1992 ** '** Copyright (c) 1992, Keithley Instruments, Inc. ** '***************************************************************** '$INCLUDE: 'ieeeqb.bi' DIM rdg!(1000) CALL initialize(21, 0) ' PC controller at 21 CALL setoutputEOS(10, 0) ' Set Input EOS to LF CALL setinputEOS(10) ' Set Output EOS to LF CALL settimeout(5000) ' Set timeout 5 seconds cmd$ = ":Syst:Pres" ' Reset 2001 GOSUB sendcmd cmd$ = ":Init:Cont Off;:Abor" ' Stop Trigger Model GOSUB sendcmd cmd$ = ":Syst:Azer:Stat Off" ' Turn Autozero off GOSUB sendcmd cmd$ = ":Init:Cont On" ' Start Trigger Model GOSUB sendcmd cmd$ = ":Sens:Func 'Volt:DC'" ' Set 2001 for DCV GOSUB sendcmd cmd$ = ":Sens:Volt:DC:Dig 4.5;Rang:Auto Off" ' Set for 4.5 Digits ' Autoranging off GOSUB sendcmd cmd$ = ":Sens:Volt:DC:Rang:Upp 20" ' Set for 20VDC Range GOSUB sendcmd cmd$ = ":Sens:Volt:DC:Aver:Stat Off;Adv:Stat Off;:init:cont on" ' Turn Filters off GOSUB sendcmd cmd$ = ":System:Amethod Astream" ' Set for ASCII stream GOSUB sendcmd SLEEP 1 ' 1 second delay for setup CLS ' Clear Screan PRINT "Test in Progress....." r$ = SPACE$(16) ' Alocate string space t1 = TIMER ' Get starting time FOR x = 1 TO 1000 ' Take 100 readings CALL enter(r$, length%, 16, status%) rdg!(x) = VAL(r$) ' Get Readings NEXT x t2 = TIMER ' Get ending time PRINT "Starting Time = "; t1 ' Print starting time PRINT "Ending Time = "; t2 ' Print ending time PRINT "Elapsed Time = "; t2 - t1 ' Print elapsed time PRINT "Readings Per Second = "; 1 / ((t2 - t1) / 1000) ' Print reading rate CALL transmit("listen 16 sdc", status%) ' Send device clear to 2001 SLEEP 1 ' 1 second delay INPUT zz$ FOR x = 1 TO 1000 PRINT rdg!(x) IF rdg!(x) > 30 THEN BEEP: BEEP: BEEP NEXT x END ' End testd sendcmd: CALL send(16, cmd$, status%) ' Send commands IF status% <> 0 THEN ' check send status PRINT status% STOP ' Stop on errors END IF RETURN